package mapreduce1;

import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Reducer;

import java.io.IOException;

public class demoReducer extends Reducer<IntWritable, NullWritable, IntWritable,IntWritable> {
    IntWritable count = new IntWritable();
    int count1=0;
    @Override
    protected void reduce(IntWritable key, Iterable<NullWritable> values, Context context) throws IOException, InterruptedException {
        for (NullWritable value:values
             ) {
            count1++;
            count.set(count1);
            context.write(count,key);
        }
    }
}
